<%@ page language="java" pageEncoding="UTF-8" isELIgnored="false"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>我的请假单</title>
<script type="text/javascript">
	function delConfirm(){
		var result = window.confirm('确认要删除该项吗？')
		return result;
	}
            
</script>
</head>
<body>

	<table border='1px' align='center' width='80%' cellpadding='0'
		cellspacing='0'>
		<tr align='center'>
			<td>请假单编号</td>
			<td>请假者</td>
			<td>请假事项</td>
			<td>请假开始时间</td>
			<td>请假结束时间</td>
			<td>状态</td>
			<td>审批者</td>
			<td>操作</td>
		</tr>
<!-- session.setAttribute("applicationPage", pageUnitForApplication); -->
		<c:forEach var="application" items="${applicationPage.applicationList }" varStatus="applicationstatus">
            <c:set var="applicationId" value="${application.applicationId }"></c:set>
			<tr align='center'>
				<td>${applicationstatus.count }</td>
				<td>${userLogin.userName }</td>
				<td>${application.applicationContent }</td>
				<td>${allTimeMap[applicationId].applicationBeginString }</td>
				<td>${allTimeMap[applicationId].applicationEndString }</td>
				<td>${application.applicationState }</td>
				<td>${application.approvalUser.userName }</td>
				<td>
				  <a href='${pageContext.request.contextPath }/servlet/updateapplicationpageservlet?id=${application.applicationId}'>修改</a>&nbsp;&nbsp;&nbsp;&nbsp;
				  <a href='${pageContext.request.contextPath }/servlet/addapplicationservlet?id=${application.applicationId}'>提交</a>&nbsp;&nbsp;&nbsp;&nbsp;
				  <a href='${pageContext.request.contextPath }/servlet/delectapplicationservlet?id=${application.applicationId}' onclick="return delConfirm()">撤销</a>
				</td>
			</tr>
		</c:forEach>
		<tr>
			<td colspan='8' align='right'>共${applicationPage.pageNum }页&nbsp;&nbsp;&nbsp;&nbsp;
				<a href='${pageContext.request.contextPath }/servlet/showapplicationservlet?currentPage=1'>第一页</a>&nbsp;&nbsp;&nbsp;&nbsp;
				<a href='${pageContext.request.contextPath }/servlet/showapplicationservlet?currentPage=${applicationPage.prePage}'>上一页</a>&nbsp;&nbsp;&nbsp;&nbsp;				
				<c:forEach begin="1" end="${applicationPage.pageNum }" var="page" >
					<a href='${pageContext.request.contextPath }/servlet/showapplicationservlet?currentPage=${page}'>${page}</a>&nbsp;&nbsp;&nbsp;&nbsp;
				</c:forEach>
				
				<a href='${pageContext.request.contextPath }/servlet/showapplicationservlet?currentPage=${applicationPage.nextPage}'>下一页</a>&nbsp;&nbsp;&nbsp;&nbsp;
				<a href='${pageContext.request.contextPath }/servlet/showapplicationservlet?currentPage=${applicationPage.pageNum }'>最后一页</a>&nbsp;&nbsp;&nbsp;&nbsp;
			</td>
		</tr>
	</table>
</body>
</html>